package com.hemerasolutions.v2trainer.controller;

import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.event.ActionEvent;

import org.primefaces.event.FileUploadEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.hemerasolutions.v2trainer.component.interfaces.table.EquipmentTableCompInterface;
import com.hemerasolutions.v2trainer.controller.interfaces.AthleteBeanInterface;
import com.hemerasolutions.v2trainer.model.examination.Exam;
import com.hemerasolutions.v2trainer.model.exercise.Equipment;
import com.hemerasolutions.v2trainer.model.modality.Modality;
import com.hemerasolutions.v2trainer.model.multimedia.Photo;
import com.hemerasolutions.v2trainer.model.schedule.Availability;
import com.hemerasolutions.v2trainer.model.schedule.Schedule;
import com.hemerasolutions.v2trainer.model.schedule.TimeInterval;
import com.hemerasolutions.v2trainer.model.training.TrainingType;
import com.hemerasolutions.v2trainer.model.users.Academy;
import com.hemerasolutions.v2trainer.model.users.Athlete;
import com.hemerasolutions.v2trainer.model.users.PersonalTrainer;
import com.hemerasolutions.v2trainer.model.users.Teacher;
import com.hemerasolutions.v2trainer.model.users.User;
import com.hemerasolutions.v2trainer.service.ExceptionService;
import com.hemerasolutions.v2trainer.service.interfaces.LibraryServiceInterface;
import com.hemerasolutions.v2trainer.service.interfaces.ModalityServiceInterface;
import com.hemerasolutions.v2trainer.service.interfaces.UserServiceInterface;


@Controller
@ManagedBean(name="athleteBean")
@Scope("view")
public class AthleteBean extends BaseBean implements AthleteBeanInterface {


	private static final long serialVersionUID = 1L;

	@Autowired
	private UserServiceInterface userService;

	@Autowired
	private LibraryServiceInterface libraryService;
	
	@Autowired 
	private ModalityServiceInterface modalityService;

	@Autowired
	private EquipmentTableCompInterface ownEquipmentTable;
	
	@Autowired
	private EquipmentTableCompInterface sharedEquipmentTable;
	
	private Modality modality;
	
	private List<Athlete> athletes;
	
	private Athlete selAthlete;
	
	private Athlete athlete;

	private Schedule selSchedule;
	
	private TimeInterval selTimeInterval;
	
	private List<TimeInterval> selScheduleDay;
	
	private Availability selAvailability;

	private Exam selExam;
	
	private String findByModalityDescription;
	
	private String findByModalityName;
	
	private List<TrainingType> trainingTypes;
	
	private Date begCreatedAt;
	
	private Date endCreatedAt;
	
	private Date begChangedAt;
	
	private Date endChangedAt;
	
	private Date begExpireOn;
    
	private Date endExpireOn;	

	private String findByUserName;
	
	private String findByFirstName;
	
	private String findByLastName;

	private String findByEmail;

	private String findByCpf;
	
	private String findByDescription;

	private List<TrainingType> findByTrainingTypes;
	
	private TrainingType findByTrainingType;

	private boolean findByStatus;
	
	private List<Modality> findUserByModalitys;
	
	private List<TrainingType> findUserByTrainingTypes;
	
	private List<Modality> findUserByModalitysAll;
	
	private List<Modality> modalitys;
	
	private List<Exam> medicalExams;
	
	private List<Exam> psycExams;
	
	private List<Exam> physExams;
	
	private List<Exam> perfomExams;
	
	private List<Equipment> ownEquipments;
	
	private List<Equipment> sharedEquipments;
	
	public AthleteBean() {
		super();
	}

	@PostConstruct
	public void init(){
		super.init();
		this.trainingTypes = this.userService.listTrainingType();
		this.findUserByModalitysAll = new ArrayList<Modality>();
		
		if(this.getActiveUserType() == User.USERTYPE_ATHLETE){
			this.athlete = this.getActiveActor(Athlete.class);
			this.ownEquipmentTable.setEquipments(this.athlete.getEquipments());
			this.ownEquipmentTable.refresh();
			
			this.sharedEquipmentTable.setEquipments(this.athlete.getSharedEquipments());
			this.sharedEquipmentTable.refresh();
		
		}else{
			this.listAll();
		}
	}
	
	private void listAll() {

	   	Map<String,Object> fields = new HashMap<String, Object>();

    	Academy academy = null;
    	PersonalTrainer pt = null;
    		   	
	   	
		if(this.getActiveUserType() == User.USERTYPE_ACADEMY){
			academy = this.getActiveActor(Academy.class);
		}else if(this.getActiveUserType() == User.USERTYPE_PT){
			pt = this.getActiveActor(PersonalTrainer.class);
		}else if(this.getActiveUserType() == User.USERTYPE_TEACHER){
			academy = this.getActiveActor(Teacher.class).getAcademy();
		}
	   	
	 
		if( academy != null){
			fields.put("academy", academy);
		}

		if(pt != null){
			fields.put("personalTrainer", pt);
		}
	   	this.athletes = this.userService.searchAthletes(fields);
	
	}	
	
	public void searchModality(){
    	Map<String,Object> fields = new HashMap<String, Object>();
    	
		if( this.begCreatedAt != null && this.endCreatedAt != null && 
				this.begCreatedAt.compareTo(this.endCreatedAt) > 0){
				this.showErrorMessage(	this.localizedText("CreationDate"),
										this.localizedText("TheInitialDateNeedToBeGreaterThanFinal"));
				return;
			}
			

		if( this.begChangedAt != null && this.endChangedAt != null && 
			this.begChangedAt.compareTo(this.endChangedAt) > 0){
			this.showErrorMessage(	this.localizedText("ChangeDate"),
									this.localizedText("TheInitialDateNeedToBeGreaterThanFinal"));
			return;			
		}
    	
    	

    	if ( this.findByModalityName != null && !this.findByModalityName.equals("")) {
            fields.put("name", this.findByModalityName);
        }

    	if ( this.findByModalityDescription != null && !this.findByModalityDescription.equals("")) {
            fields.put("description", this.findByModalityDescription);
        }

    	
    	if (this.findByTrainingType != null){
    		fields.put("trainingType",this.findByTrainingType);
    	}

    	if (this.begCreatedAt != null){
    		fields.put("begCreatedAt", this.begCreatedAt);
    	}
    	if (this.endCreatedAt != null){
            fields.put("endCreatedAt",this.endCreatedAt);
        }
        if (this.begChangedAt != null){
        	fields.put("begChangedAt",this.begChangedAt);
        }
        if (this.endChangedAt != null){
        	fields.put("endChangedAt", this.endChangedAt);
        }
        
    	fields.put("librarys", this.getActiveUserAllowedLibrarys());
        
        this.modalitys = this.modalityService.searchModalitys(fields);
	    
	    for(Schedule sched:this.athlete.getSchedules()){
	    	this.modalitys.remove(sched.getModality());
	    }
	    
		if((this.modalitys).isEmpty()){
			this.showInfoMessage(	this.localizedText("SearchCompleted"),
									this.localizedText("NoEntrysFounded"));
		}else{
			this.showInfoMessage(	this.localizedText("SearchCompleted"),
									this.modalitys.size() + " " + 
									this.localizedText("entrysFounded"));
		}
	}
	
	public void saveAthlete(){
		try {
			userService.saveAthlete(athlete);
			this.showInfoMessage(	this.localizedText("SavedWithSuccess"),
					this.localizedText("TheAthlete") + " " +
					this.athlete.getFirstName() + " " + 
					this.localizedText("wasSavedWithSuccess"));			
			this.listAll();
			
		} catch (ExceptionService e) {
			this.showErrorMessage(this.localizedText("SaveError"), e.getLocalizedMessage());
		}		
	}
	
	public void deleteAthlete(){
		try{
			userService.deleteAthlete(athlete);
			this.showInfoMessage(	this.localizedText("Deleted"),
									this.localizedText("UserDeletedWithSuccess"));
			this.athletes.remove(athlete);
			this.athlete = null;
		}catch(ExceptionService e){
			this.showErrorMessage(this.localizedText("DeleteError"),
					e.getLocalizedMessage());
		}
	}

	public void createAthlete(){
		try {

			userService.createAthlete(athlete);
			this.showInfoMessage(	this.localizedText("CreatedWithSuccess"),
					this.localizedText("TheAthlete") + " " +
					this.athlete.getFirstName() + " " + 
					this.localizedText("wasCreatedWithSuccess"));			
			this.athlete = null;
			this.listAll();
		} catch (ExceptionService e) {
			this.showErrorMessage(this.localizedText("CreateError"), e.getLocalizedMessage());
			e.printStackTrace();
		}		
	}

	public void search(){

    	Map<String,Object> fields = new HashMap<String, Object>();
    	Academy academy = null;
    	PersonalTrainer pt = null;
    	
		if( this.begCreatedAt != null && this.endCreatedAt != null && 
				this.begCreatedAt.compareTo(this.endCreatedAt) > 0){
				this.showErrorMessage(	this.localizedText("CreationDate"),
										this.localizedText("TheInitialDateNeedToBeGreaterThanFinal"));
				return;
		}

		if( this.begChangedAt != null && this.endChangedAt != null && 
			this.begChangedAt.compareTo(this.endChangedAt) > 0){
			this.showErrorMessage(	this.localizedText("ChangeDate"),
									this.localizedText("TheInitialDateNeedToBeGreaterThanFinal"));
			return;			
		}
 
		if( this.begExpireOn != null && this.endExpireOn != null && 
				this.begExpireOn.compareTo(this.endExpireOn) > 0){
				this.showErrorMessage(	this.localizedText("ExpireDate"),
										this.localizedText("TheInitialDateNeedToBeGreaterThanFinal"));
				return;
		}

		if(this.getActiveUserType() == User.USERTYPE_ACADEMY){
			academy = this.getActiveActor(Academy.class);
		}else if(this.getActiveUserType() == User.USERTYPE_PT){
			pt = this.getActiveActor(PersonalTrainer.class);
		}

		if( academy != null){
			fields.put("academy", academy);
		}

		if(pt != null){
			fields.put("personalTrainer", pt);
		}
		
    	if (!this.findByFirstName.equals("")) {
            fields.put("firstName", this.findByFirstName);
        }

    	if (!this.findByLastName.equals("")) {
            fields.put("lastName", this.findByLastName);
        }


    	if(this.findUserByModalitys != null && !this.findUserByModalitys.isEmpty()){
    		fields.put("modalitys",this.findUserByModalitys);
    	}
    	
    	if(this.findUserByTrainingTypes != null && !this.findUserByTrainingTypes.isEmpty()){
    		fields.put("trainingTypes",this.findUserByTrainingTypes);
    	}
    	
    	if (!this.findByEmail.equals("")){
    		fields.put("email",this.findByEmail);
    	}
    	
    	if (this.begCreatedAt != null){
    		fields.put("begCreatedAt", this.begCreatedAt);
    	}
    	if (this.endCreatedAt != null){
            fields.put("endCreatedAt",this.endCreatedAt);
        }
        if (this.begChangedAt != null){
        	fields.put("begChangedAt",this.begChangedAt);
        }
        if (this.endChangedAt != null){
        	fields.put("endChangedAt", this.endChangedAt);
        }

        if (this.begExpireOn != null){
        	fields.put("begExpireOn",this.begExpireOn);
        }
        if (this.endExpireOn != null){
        	fields.put("endExpireOn", this.endExpireOn);
        }        
        
	    fields.put("active", this.findByStatus);
		
	    this.athletes = this.userService.searchAthletes(fields);
	    
	    
		if((this.athletes).isEmpty()){
			this.showInfoMessage(	this.localizedText("SearchCompleted"),
									this.localizedText("NoEntrysFounded"));
		}else{
			this.showInfoMessage(	this.localizedText("SearchCompleted"),
									this.athletes.size() + " " + 
									this.localizedText("entrysFounded"));
		}
	}
	
	public void toAddAthlete(){
		this.athlete = new Athlete();

		if(this.getActiveUserType() == User.USERTYPE_ACADEMY){
			this.athlete.getAcademys().add(this.getActiveActor(Academy.class));
		}else if(this.getActiveUserType() == User.USERTYPE_PT){
			this.athlete.getPersonalTrainers().add(this.getActiveActor(PersonalTrainer.class));
		}
		
		this.athlete.setPhoto(this.userService.copyDefaultUserPhoto());

		this.ownEquipmentTable.setEquipments(this.athlete.getEquipments());
		this.ownEquipmentTable.refresh();
		
		this.sharedEquipmentTable.setEquipments(this.athlete.getSharedEquipments());
		this.sharedEquipmentTable.refresh();
	}
	
	
	public void cancelChange(){
		this.athlete = this.userService.readAthlete(this.athlete);
	}
	
	public void addModality(){
		Schedule sched = new Schedule();
		
		sched.setModality(this.modality);
		sched.setBeginDate(new Date());
		sched.setName(this.modality.getName());

		this.athlete.getSchedules().add(sched);
		
		this.modalitys.remove(this.modality);
	}
	
	public void deleteSchedule(ActionEvent ev){
		this.athlete.getSchedules().remove(this.selSchedule);
	}

	public void validateIntervals(){
		for(TimeInterval interv:this.selScheduleDay){
			if(interv.getType() == 0){
				if(interv.getEndTime().compareTo(interv.getBegTime()) <= 0 ){
					this.showErrorMessage(	this.localizedText("Interval"),
							this.localizedText("TheInitialDateNeedToBeGreaterThanFinal"));				
				}	
			}
		}
	}
	
	public String getSumIntervals(){

		DecimalFormat decFormat = new DecimalFormat("00");
		
		long totalTime = 0;

		try {
			if(this.selScheduleDay != null){

				totalTime = sumDayTime(this.selScheduleDay);
				
				long diffSeconds = totalTime / 1000 % 60;
				long diffMinutes = totalTime / (60 * 1000) % 60;
				long diffHours = totalTime / (60 * 60 * 1000) % 24;
		
				return decFormat.format(diffHours) + ":" + decFormat.format(diffMinutes) + ":" +  decFormat.format(diffSeconds);
			}

		} catch (ParseException e) {
			e.printStackTrace();
		}
		
		return null;
	}

	public String getSumAllIntervals(){

		DecimalFormat decFormat = new DecimalFormat("00");
		
		long totalTime = 0;

		try {
			if(this.athlete != null ){
				for(Schedule schedule: this.athlete.getSchedules()){
					totalTime =  totalTime + sumDayTime( schedule.getAvailability().getMonday());
					totalTime =  totalTime + sumDayTime( schedule.getAvailability().getTuesday());
					totalTime =  totalTime + sumDayTime( schedule.getAvailability().getThursday());
					totalTime =  totalTime + sumDayTime( schedule.getAvailability().getWednesday());
					totalTime =  totalTime + sumDayTime( schedule.getAvailability().getFriday());
					totalTime =  totalTime + sumDayTime( schedule.getAvailability().getSaturday());
					totalTime =  totalTime + sumDayTime( schedule.getAvailability().getSunday());
				}
	
				long diffSeconds = totalTime / 1000 % 60;
				long diffMinutes = totalTime / (60 * 1000) % 60;
				long diffHours = totalTime / (60 * 60 * 1000) ;
	
				return decFormat.format(diffHours) + ":" + decFormat.format(diffMinutes) + ":" +  decFormat.format(diffSeconds);
			}		
		}catch (ParseException e) {
			e.printStackTrace();
		}
		
		return null;
	}

	private long sumDayTime(List<TimeInterval> intervs) throws ParseException {

		SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss");
		long totalTime = 0;
		
		
		for(TimeInterval interv:intervs){
			if(interv.getType() == 0 && interv.getEndTime() != null && interv.getBegTime() != null ){
				if(!(interv.getEndTime().compareTo(interv.getBegTime()) <= 0 )){
					Date d1 = format.parse(format.format(interv.getBegTime()));
					Date d2 = format.parse(format.format(interv.getEndTime()));
					totalTime = totalTime + ( d2.getTime() - d1.getTime());
				}	
			}else if(interv.getTotalTime() != null) {
					Date d3 = format.parse(format.format(interv.getTotalTime()));
					Date d4 = format.parse(format.format(this.begDayDateHour(interv.getTotalTime())));
					totalTime = totalTime + ( d3.getTime() - d4.getTime());
			}
		}
		return totalTime;
	}
	

	
	public void onFindUserByTrainingTypesChange(){
    	Map<String,Object> fields = new HashMap<String, Object>();

    	fields.put("librarys",this.getActiveUserAllowedLibrarys());
    	
    	if(this.findUserByTrainingTypes != null && !this.findUserByTrainingTypes.isEmpty()){
        	fields.put("trainingTypes",this.findUserByTrainingTypes);
    	}
		
		this.findUserByModalitysAll = this.modalityService.searchModalitys(fields);
	}
	
	public void deleteExam(){
		
	}

	public void addExam(){
		
	}
	
	public void viewExam(){	
		
	}

	public void editExam(){	
		
	}

	public void toViewAthlete(){
		this.ownEquipmentTable.setEquipments(this.athlete.getEquipments());
		this.ownEquipmentTable.refresh();
		
		this.sharedEquipmentTable.setEquipments(this.athlete.getSharedEquipments());
		this.sharedEquipmentTable.refresh();
	}
	
	public void addTimeInterval(){
		this.selScheduleDay.add(new TimeInterval());
	}
	
	public void deleteTimeInterval(){
		this.selScheduleDay.remove(this.selTimeInterval);
	}
	
	public void upload(FileUploadEvent ev) {

		Photo photo = new Photo();

		photo.setName("user_photo");
		photo.setHeight(120);
		photo.setWidth(100);
		
		athlete.setPhoto(super.uploadPhoto(ev, photo));
		athlete.getPhoto().setLocation(userService.persistPhotoInFile(photo));
		
	}
	
	public void changeIntervalType(){
		if(this.selTimeInterval.getType() == 1){
			this.selTimeInterval.setBegTime(null);
			this.selTimeInterval.setEndTime(null);
		}else{
			this.selTimeInterval.setTotalTime(null);
		}
	}
	
	public List<Athlete> getAthletes() {
		return athletes;
	}

	public Athlete getSelAthlete() {
		return selAthlete;
	}

	public Athlete getAthlete() {
		return athlete;
	}

	public void setAthletes(List<Athlete> athletes) {
		this.athletes = athletes;
	}

	public void setSelAthlete(Athlete selAthlete) {
		this.selAthlete = selAthlete;
	}

	public void setAthlete(Athlete athlete) {
		this.athlete = athlete;
	}

	public Schedule getSelSchedule() {
		return selSchedule;
	}

	public void setSelSchedule(Schedule selSchedule) {
		this.selSchedule = selSchedule;
	}
	
	public Availability getSelAvailability() {
		return selAvailability;
	}

	public void setSelAvailability(Availability selAvailability) {
		this.selAvailability = selAvailability;
	}

	public List<TrainingType> getTrainingTypes() {
		return trainingTypes;
	}

	public void setTrainingTypes(List<TrainingType> trainingTypes) {
		this.trainingTypes = trainingTypes;
	}

	public String getFindByModalityDescription() {
		return findByModalityDescription;
	}

	public void setFindByModalityDescription(String findByModalityDescription) {
		this.findByModalityDescription = findByModalityDescription;
	}

	public String getFindByModalityName() {
		return findByModalityName;
	}

	public void setFindByModalityName(String findByModalityName) {
		this.findByModalityName = findByModalityName;
	}

	public Date getBegCreatedAt() {
		return begCreatedAt;
	}

	public Date getEndCreatedAt() {
		return endCreatedAt;
	}

	public Date getBegChangedAt() {
		return begChangedAt;
	}

	public Date getEndChangedAt() {
		return endChangedAt;
	}

	public void setBegCreatedAt(Date begCreatedAt) {
		this.begCreatedAt = begCreatedAt;
	}

	public void setEndCreatedAt(Date endCreatedAt) {
		this.endCreatedAt = endCreatedAt;
	}

	public void setBegChangedAt(Date begChangedAt) {
		this.begChangedAt = begChangedAt;
	}

	public void setEndChangedAt(Date endChangedAt) {
		this.endChangedAt = endChangedAt;
	}

	public UserServiceInterface getUserService() {
		return userService;
	}

	public LibraryServiceInterface getLibraryService() {
		return libraryService;
	}

	public String getFindByDescription() {
		return findByDescription;
	}

	public List<TrainingType> getFindByTrainingTypes() {
		return findByTrainingTypes;
	}

	public List<Modality> getModalitys() {
		return modalitys;
	}

	public void setUserService(UserServiceInterface userService) {
		this.userService = userService;
	}

	public void setLibraryService(LibraryServiceInterface libraryService) {
		this.libraryService = libraryService;
	}

	public void setFindByDescription(String findByDescription) {
		this.findByDescription = findByDescription;
	}

	public void setFindByTrainingTypes(List<TrainingType> findByTrainingTypes) {
		this.findByTrainingTypes = findByTrainingTypes;
	}

	public void setModalitys(List<Modality> modalitys) {
		this.modalitys = modalitys;
	}

	public List<TimeInterval> getSelScheduleDay() {
		return selScheduleDay;
	}

	public void setSelScheduleDay(List<TimeInterval> selScheduleDay) {
		this.selScheduleDay = selScheduleDay;
	}

	public TimeInterval getSelTimeInterval() {
		return selTimeInterval;
	}

	public void setSelTimeInterval(TimeInterval selTimeInterval) {
		this.selTimeInterval = selTimeInterval;
	}

	public Exam getSelExam() {
		return selExam;
	}

	public void setSelExam(Exam selExam) {
		this.selExam = selExam;
	}

	public List<Exam> getMedicalExams() {
		return medicalExams;
	}

	public List<Exam> getPsycExams() {
		return psycExams;
	}

	public List<Exam> getPhysExams() {
		return physExams;
	}

	public List<Exam> getPerfomExams() {
		return perfomExams;
	}

	public void setMedicalExams(List<Exam> medicalExams) {
		this.medicalExams = medicalExams;
	}

	public void setPsycExams(List<Exam> psycExams) {
		this.psycExams = psycExams;
	}

	public void setPhysExams(List<Exam> physExams) {
		this.physExams = physExams;
	}

	public void setPerfomExams(List<Exam> perfomExams) {
		this.perfomExams = perfomExams;
	}

	public List<Equipment> getOwnEquipments() {
		return ownEquipments;
	}

	public List<Equipment> getSharedEquipments() {
		if(this.athlete != null){
		}
		
		return sharedEquipments;
	}

	public void setOwnEquipments(List<Equipment> ownEquipments) {
		this.ownEquipments = ownEquipments;
	}

	public String getFindByFirstName() {
		return findByFirstName;
	}

	public void setFindByFirstName(String findByFirstName) {
		this.findByFirstName = findByFirstName;
	}

	public void setSharedEquipments(List<Equipment> sharedEquipments) {
		this.sharedEquipments = sharedEquipments;
	}
	public String getFindByUserName() {
		return findByUserName;
	}

	public String getFindByLastName() {
		return findByLastName;
	}

	public String getFindByEmail() {
		return findByEmail;
	}

	public void setFindByUserName(String findByUserName) {
		this.findByUserName = findByUserName;
	}

	public void setFindByLastName(String findByLastName) {
		this.findByLastName = findByLastName;
	}

	public void setFindByEmail(String findByEmail) {
		this.findByEmail = findByEmail;
	}

	public boolean isFindByStatus() {
		return findByStatus;
	}

	public void setFindByStatus(boolean findByStatus) {
		this.findByStatus = findByStatus;
	}

	public TrainingType getFindByTrainingType() {
		return findByTrainingType;
	}

	public void setFindByTrainingType(TrainingType findByTrainingType) {
		this.findByTrainingType = findByTrainingType;
	}

	public Modality getModality() {
		return modality;
	}

	public void setModality(Modality modality) {
		this.modality = modality;
	}

	public String getFindByCpf() {
		return findByCpf;
	}

	public void setFindByCpf(String findByCpf) {
		this.findByCpf = findByCpf;
	}

	public Date getBegExpireOn() {
		return begExpireOn;
	}

	public Date getEndExpireOn() {
		return endExpireOn;
	}

	public void setBegExpireOn(Date begExpireOn) {
		this.begExpireOn = begExpireOn;
	}

	public void setEndExpireOn(Date endExpireOn) {
		this.endExpireOn = endExpireOn;
	}

	public List<Modality> getFindUserByModalitys() {
		return findUserByModalitys;
	}

	public void setFindUserByModalitys(List<Modality> findUserByModalitys) {
		this.findUserByModalitys = findUserByModalitys;
	}

	public List<TrainingType> getFindUserByTrainingTypes() {
		return findUserByTrainingTypes;
	}

	public void setFindUserByTrainingTypes(List<TrainingType> findUserByTrainingTypes) {
		this.findUserByTrainingTypes = findUserByTrainingTypes;
	}

	public List<Modality> getFindUserByModalitysAll() {
		return findUserByModalitysAll;
	}

	public void setFindUserByModalitysAll(List<Modality> findUserByModalitysAll) {
		this.findUserByModalitysAll = findUserByModalitysAll;
	}

	public EquipmentTableCompInterface getOwnEquipmentTable() {
		return ownEquipmentTable;
	}

	public void setOwnEquipmentTable(EquipmentTableCompInterface ownEquipmentTable) {
		this.ownEquipmentTable = ownEquipmentTable;
	}

	public EquipmentTableCompInterface getSharedEquipmentTable() {
		return sharedEquipmentTable;
	}

	public void setSharedEquipmentTable(
			EquipmentTableCompInterface sharedEquipmentTable) {
		this.sharedEquipmentTable = sharedEquipmentTable;
	}
		
	
}
